﻿''' <summary>
''' Provides a stationary image as a background layer for the game.
''' </summary>
''' <remarks></remarks>
Public Class StaticBackground
    Inherits GameBackground

    Protected Friend Overrides Sub OnDraw(ByVal e As DrawEventArgs)
        If _BackgroundImage.Length > 0 Then
            Dim background As Image = e.Engine.CurrentScene.GetImageAsset(_BackgroundImage)
            Dim bounds As Rectangle = e.Engine.Canvas.DisplayRectangle
            e.PaintEventArgs.Graphics.DrawImage(background, bounds, 0, 0, background.Width, background.Height, GraphicsUnit.Pixel)
            background = Nothing
        End If
        MyBase.OnDraw(e)
    End Sub
End Class
